<HTML><HEAD><TITLE>?Vars &:: +Domain</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(ic_symbolic)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>?Vars &:: +Domain</H1>
All elements of Vars have a value in the domain Domain
<DL>
<DT><EM>Vars</EM></DT>
<DD>variable or atomic value, list of them, or submatrix of them
</DD>
<DT><EM>Domain</EM></DT>
<DD>domain name (atom) or list of domain elements
</DD>
</DL>
<H2>Description</H2>
<P>
	Constrains a variable, or a list or submatrix of variables, to be in
	the domain Domain.
	Domain must be the name of a previously declared domain (see domain/1),
	or a sub-domain, expressed as a list of values from a single domain.
	A domain variable can only be instantiated to values within its domain.
	</P><P>
	Note that, on the left hand side of &::/2, the atom [] is not
	interpreted as the empty list but as a potential domain element.
	</P>

<H3>Modules</H3>
This predicate is sensitive to its module context (tool predicate, see @/2).
<H2>Examples</H2>
<PRE>
    ?- X &amp;:: weekday.
    X = X{[mo, tu, we, th, fr, sa, su]}
    Yes (0.00s cpu)

    ?- [X,Y,we] &amp;:: weekday.
    X = X{[mo, tu, we, th, fr, sa, su]}
    Y = Y{[mo, tu, we, th, fr, sa, su]}
    Yes (0.00s cpu)

    ?- dim(M,[3]), M[1..3] &amp;:: weekday.
    M = [](_306{[mo, tu, we, th, fr, sa, su]}, ...)
    Yes (0.00s cpu)

    ?- [X,Y] &amp;:: [we,fr,su].
    X = X{[we, fr, su]}
    Y = Y{[we, fr, su]}

    ?- X &amp;:: [].
    No (0.00s cpu)
    </PRE>
<H2>See Also</H2>
<A HREF="../../kernel/termcomp/domain-1.html">domain / 1</A>, <A HREF="../../kernel/termcomp/current_domain-3.html">current_domain / 3</A>, <A HREF="../../kernel/termcomp/domain_index-3.html">domain_index / 3</A>
</BODY></HTML>
